package com.fashare.activitytracker.slice;

import ohos.accessibility.AccessibilityAbilityInfo;
import ohos.accessibility.AccessibilityStateEvent;
import ohos.accessibility.AccessibilityStateObserver;
import ohos.accessibility.AccessibilitySystemAbilityClient;
import ohos.app.Context;

import java.util.List;

///**
// * Created by jinliangshan on 16/12/26.
// */
//设置辅助功能页
public class AccessibilityUtil {
    public static boolean checkAccessibility(Context context) {
        //获取无障碍服务的列表
        AccessibilitySystemAbilityClient.getInstance(context).getAbilityList(AccessibilityAbilityInfo.ACCESSIBILITY_ABILITY_TYPE_GENERIC, AccessibilityStateEvent.EVENT_ACCESSIBILITY_STATE_CHANGED);
        //判断无障碍是否开启
        AccessibilitySystemAbilityClient.getInstance(context).isEnabled();

//          监听无障碍更改事件
//        AccessibilitySystemAbilityClient.getInstance(context).subscribeStateObserver(new AccessibilityStateObserver() {
//            @Override
//            public void onStateChanged(AccessibilityStateEvent accessibilityStateEvent) {
//
//            }
//        },AccessibilityStateEvent.EVENT_ACCESSIBILITY_STATE_CHANGED);
        return false;
    }
}
